<?php

class Eleven_Model_User extends CMS_Model_Acl_Abstract
{
	public function getUserById($id)
	{
		$id = (int) $id;
		return $this->getResource('User')->getUserById($id);
	}
	
    public function getUserByUsername($username)
    {
        return $this->getResource('User')->getUserByUsername($username);
    }
    
    public function getResourceId()
    {
        return 'User';
    }
    
    public function setAcl(CMS_Acl_Interface $acl)
    {
        if (!$acl->has($this->getResourceId()))
        {
            $acl->add($this)
                ->allow('Guest', $this, array());
            $this->_acl = $acl;
            return $this;
        }
    }
    
    public function getAcl()
    {
        if (null === $this->_acl)
        {
            $this->setAcl(new Eleven_Model_Acl());
        }
        
        return $this->_acl; 
    }

}

?>